package com.zhonggong.five;

public class Int {
	
	private int value;
	
	public Int(int value) {
		super();
		this.value = value;
	}

	public int getValue() {
		return value;
	}

	public void setValue(int value) {
		this.value = value;
	}

	public boolean isPrime() {
		if (value<2) {
			return false;
		}
		for(int i=2;i<value;i++) {
			if (value%i==0) {
				return false;
			}
		}
		return true;
	}
	
	public static boolean isPrime(int value) {
		if (value<2) {
			return false;
		}
		for(int i=2;i<value;i++) {
			if (value%i==0) {
				return false;
			}
		}
		return true;
	}
	
	public static boolean isPrime(Int value)
	{
		return value.isPrime();
	}
	
	public boolean isEven()
	{
		if(value%2 == 0)return true;
		return false;
	}
	public static boolean isEven(int value)
	{
		if(value%2 == 0)return true;
		return false;
	}
	public static boolean isEven(Int value)
	{
		return value.isEven();
	}
	public boolean equals(int anotherValue)
	{
		if(this.value==anotherValue)return true;
		return false;
	}
	public boolean equals(Int anotherValue)
	{
		if(this.value==anotherValue.getValue())return true;
		return false;
	}
}
